home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / ax3.00 / accounts.c next >
Encoding:
C/C++ Source or Header  |  1980-01-03  |  20.9 KB  |  766 lines

  1. #include "bbs.h"
  2.  
  3. extern BYTE NOFKeys,OnlineEdit;
  4. extern long GL1;
  5. extern struct User GHoozer;
  6. extern struct UserKeys GHoozer2;
  7. extern long Time_limit;
  8. int F6=0;
  9.  
  10. void DeleteConfAccess(int slot);
  11. static UBYTE UUCPNumberInput(void)
  12. {
  13.  AEPutStr(" \b");
  14.  LineInput("",GSTR1,1,KEYBOARD_TIMEOUT);
  15.  return((UBYTE)atol(GSTR1));
  16. }
  17.  
  18. static int NumberInput(void)
  19. {
  20.  AEPutStr("     \b\b\b\b\b");
  21.  LineInput("",GSTR1,5,KEYBOARD_TIMEOUT);
  22.  return((int)atol(GSTR1));
  23. }
  24.  
  25. static ULONG LongNumberInput(void)
  26. {
  27.  AEPutStr("          \b\b\b\b\b\b\b\b\b\b");
  28.  LineInput("",GSTR1,10,KEYBOARD_TIMEOUT);
  29.  return((ULONG)atol(GSTR1));
  30. }
  31.  
  32. long Find_Last_Account(void)
  33. {
  34.  BPTR fh;
  35.  long size;
  36.  
  37.  strcpy(GSTR1,UserDataLoc);
  38.  if(!(fh=Open(GSTR1,MODE_OLDFILE))) return(FAILURE);
  39.  
  40.  size=MySeek(fh,0,OFFSET_END);
  41.  Close(fh);
  42.  return((long)(size/sizeof(struct User)));
  43. }
  44.  
  45. long Append(struct User *hoozer, struct UserKeys *hoozer2)
  46. {
  47.  long stat;
  48.  BPTR fh;
  49.  
  50. strcpy(GSTR1,UserDataLoc);
  51.  if(!(fh=Open(GSTR1,MODE_OLDFILE)))
  52.  {
  53.    if(Whence_The_Logon>=REMOTE_LOGON) return(FAILURE);
  54.    fh=Open(GSTR1,MODE_NEWFILE);
  55.    if(fh==NULL) return(FAILURE);
  56.  }else
  57.  Seek(fh,0,OFFSET_END);
  58.  
  59.  stat=Write(fh,(char *)hoozer,sizeof(struct User));
  60.  if(stat!=sizeof(struct User))    {
  61.      Close(fh);        return(FAILURE);
  62.     }
  63.  Close(fh);
  64.  
  65. strcpy(GSTR1,UserKeyLoc);
  66.  if(!(fh=Open(GSTR1,MODE_OLDFILE))) return(FAILURE);
  67.  Seek(fh,0,OFFSET_END);
  68.  
  69.  stat=Write(fh,(char *)hoozer2,sizeof(struct UserKeys));
  70.  if(stat!=sizeof(struct UserKeys))    {
  71.      Close(fh);        return(FAILURE);
  72.     }
  73.  Close(fh);
  74.  return(Find_Last_Account());
  75. }
  76.  
  77. int Find_Open_Account(struct User *hoozer, struct UserKeys *hoozer2)
  78. {
  79. int slot;
  80. long stat;
  81. BPTR fh;
  82.  
  83. strcpy(GSTR1,UserKeyLoc);
  84. if(!(fh=Open(GSTR1,MODE_OLDFILE)))
  85. {
  86.   if(Whence_The_Logon>=REMOTE_LOGON) return(FAILURE);
  87.   fh=Open(GSTR1,MODE_NEWFILE);
  88.   if(fh==NULL) return(FAILURE);
  89.   Close(fh);
  90.   fh=Open(GSTR1,MODE_OLDFILE);
  91.   if(fh==NULL) return(FAILURE);
  92. }
  93. slot=0;
  94. for(;;)    {
  95.      stat=Read(fh,(char *)hoozer2,sizeof(struct UserKeys));
  96.         slot+=1;
  97.         if(stat!=sizeof(struct UserKeys)) {
  98.             Close(fh);
  99.             slot=(int)Append(hoozer,hoozer2);
  100.             hoozer->Slot_Number=slot;
  101.             return(SUCCESS);
  102.         }
  103.         if(hoozer2->Number==0 && Sopt->Toggles[13]) {
  104.             Close(fh);
  105.             hoozer->Slot_Number=hoozer2->Number=slot;
  106.             return(SUCCESS);
  107.         }
  108.     }
  109.  Close(fh);
  110.  return(SUCCESS);
  111. }
  112.  
  113. static void Display_Account(int who, struct User *hoozer, struct UserKeys *hoozer2)
  114. {
  115.  if(hoozer->Slot_Number==who)    {
  116.         sprintf(GSTR1,"H  ACTIVE [%hu]   BAUD: %d\r\n",hoozer->Slot_Number,hoozer2->baud_rate);
  117.         AEPutStr(GSTR1);
  118.  
  119.     } else {
  120.      sprintf(GSTR1,"HINACTIVE [%hu]     \r\n",who);
  121.         AEPutStr(GSTR1);
  122.     }
  123.  
  124.  sprintf(GSTR1,"HA> Name: %-32s ",hoozer->Name);
  125.  AEPutStr(GSTR1);
  126.  sprintf(GSTR1,"2HB> Loc.: %-29s\r\n",hoozer->Location);
  127.  AEPutStr(GSTR1);
  128.  
  129.  AEPutStr("C> Pass ..........: ENCRYPTED\r\n");
  130.  
  131.  sprintf(GSTR1,"D> Phone Number ..: %-13s",hoozer->PhoneNumber);
  132.  AEPutStr(GSTR1);
  133.  
  134.  sprintf(GSTR1,"HE> Ratio .........: %-7hu\r\n",hoozer->Sec_Library);
  135.  AEPutStr(GSTR1);
  136.  sprintf(GSTR1,"6HF> Area Name......: %s",hoozer->Conference_Access);
  137.  AEPutStr(GSTR1);
  138.  
  139.  sprintf(GSTR1,"HG> Ratio Type ....: %-5hu",hoozer->Sec_Board);
  140.  AEPutStr(GSTR1);
  141.  if(hoozer->Sec_Board==0) AEPutStr(" <-Byte)");
  142.  if(hoozer->Sec_Board==1) AEPutStr(" <-B/F) ");
  143.  if(hoozer->Sec_Board==2) AEPutStr(" <-File)");
  144.  
  145.  sprintf(GSTR1,"6HH> Sec_Level .....: %-5hu",hoozer->Sec_Status);
  146.  AEPutStr(GSTR1);
  147.  
  148.  sprintf(GSTR1,"HI> Uploads .......: %-10hu\r\n",hoozer->Uploads);
  149.  AEPutStr(GSTR1);
  150.  sprintf(GSTR1,"6HJ> AutoReJoin ....: %-10hu",hoozer->ConfRJoin);
  151.  AEPutStr(GSTR1);
  152.  
  153.  sprintf(GSTR1,"HK> Downloads .....: %-10hu\r\n",hoozer->Downloads);
  154.  AEPutStr(GSTR1);
  155.  
  156.  sprintf(GSTR1,"6HL> Messages_Posted: %-7hu",hoozer->Messages_Posted);
  157.  AEPutStr(GSTR1);
  158.  sprintf(GSTR1,"HM> Bytes Uled ....: %-10ld\r\n",hoozer->Bytes_Upload);
  159.  AEPutStr(GSTR1);
  160.  
  161.  sprintf(GSTR1,"6HN> New_User ......: %s #Calls%-12ld",(hoozer->New_User?"Yes":"No "),hoozer->Times_Called);
  162.  AEPutStr(GSTR1);
  163.  sprintf(GSTR1,"1HO> Bytes Dled ....: %-10ld\r\n",hoozer->Bytes_Download);
  164.  AEPutStr(GSTR1);
  165.  
  166.  sprintf(GSTR2,"%s",ctime(&hoozer->Time_Last_On));
  167.  GSTR2[24]='\0';
  168.  sprintf(GSTR1,"9HLast Called ...: %s",GSTR2);
  169.  AEPutStr(GSTR1);
  170.  sprintf(GSTR1,"1HQ> Byte Limit ....: %-10ld\r\n",hoozer->Daily_Bytes_Limit);
  171.  AEPutStr(GSTR1);
  172.  
  173.  sprintf(GSTR1,"39HComputer Type .: %-16s",ComputerTypes[hoozer->Sec_Bulletin]);
  174.  AEPutStr(GSTR1);
  175.       AEPutStr("39HScreen Type  ..: ");
  176.  sprintf(GSTR1,"%sScreenTypes",Cmds->BBSLoc);
  177.   sprintf(GSTR2,"TITLE.%d",hoozer->ScreenType+1);
  178.   AEPutStr("56H");
  179.   if(GetFromIconStr(GSTR1,GSTR2,GSTR2))
  180.   {
  181.     sprintf(GSTR1,"%-16s",GSTR2);
  182.     AEPutStr(GSTR1);
  183.   }
  184. //(RTS)
  185.  sprintf(GSTR1,"36HY> Cps UP: %-4hu ",hoozer2->UPcps);
  186.  AEPutStr(GSTR1);
  187.  
  188.  sprintf(GSTR1,"57HZ> Cps DN: %-4hu ",hoozer2->DNcps);
  189.  AEPutStr(GSTR1);
  190.  
  191.  sprintf(GSTR1,"1HR> Time_Limit: [%-8lu] secs    ",hoozer->Time_Limit);
  192.  AEPutStr(GSTR1);
  193.  sprintf(GSTR1," S> Time_Used: [%-8lu] secs  T> UUCP%d\r\n",hoozer->Time_Used,hoozer->UUCPA);
  194.  AEPutStr(GSTR1);
  195.  AEPutStr("\r\n");
  196.  
  197.  AEPutStr("X=EXIT-NOSAVE TAB=Cont  ~=SAVE  1-6=Presets  9=RE-ACTIVATE  DEL=DELETE\r\n");
  198. }
  199.  
  200. static void Display_Account_Info(int who, struct User *hoozer,struct UserKeys *hoozer2)
  201. {
  202.  if(hoozer->Slot_Number==who)    {
  203.         sprintf(GSTR1,"H  ACTIVE [%hu]   BAUD: %d\r\n",hoozer->Slot_Number,hoozer2->baud_rate);
  204. //        sprintf(GSTR1,"H  ACTIVE [%hu]     \r\n",hoozer->Slot_Number);
  205.         AEPutStr(GSTR1);
  206.     } else {
  207.      sprintf(GSTR1,"HINACTIVE [%hu]     \r\n",who);
  208.         AEPutStr(GSTR1);
  209.     }
  210.  
  211.  sprintf(GSTR1,"0H%-32s",hoozer->Name);
  212.  AEPutStr(GSTR1);
  213.  sprintf(GSTR1,"1H%-29s",hoozer->Location);
  214.  AEPutStr(GSTR1);
  215.  
  216.  AEPutStr("1HENCRYPTED\r\n");
  217.  
  218.  sprintf(GSTR1,"1H%-13s",hoozer->PhoneNumber);
  219.  AEPutStr(GSTR1);
  220.  
  221.  sprintf(GSTR1,"1H%-7hu",hoozer->Sec_Library);
  222.  AEPutStr(GSTR1);
  223.  
  224.  sprintf(GSTR1,"6H%-10s",hoozer->Conference_Access);
  225.  AEPutStr(GSTR1);
  226.  
  227.  sprintf(GSTR1,"1H%-5hu",hoozer->Sec_Board);
  228.  AEPutStr(GSTR1); 
  229.   if(hoozer->Sec_Board==0) AEPutStr(" <-Byte)");
  230.  if(hoozer->Sec_Board==1) AEPutStr(" <-B/F) ");
  231.  if(hoozer->Sec_Board==2) AEPutStr(" <-File)");
  232.  
  233.  sprintf(GSTR1,"6H%-5hu",hoozer->Sec_Status);
  234.  AEPutStr(GSTR1);
  235.  
  236.  sprintf(GSTR1,"1H%-10hu",hoozer->Uploads);
  237.  AEPutStr(GSTR1);
  238.  sprintf(GSTR1,"6H%-7hu",hoozer->ConfRJoin);
  239.  AEPutStr(GSTR1);
  240.  
  241.  sprintf(GSTR1,"1H%-10hu",hoozer->Downloads);
  242.  AEPutStr(GSTR1);
  243.  
  244.  sprintf(GSTR1,"6H%-7hu",hoozer->Messages_Posted);
  245.  AEPutStr(GSTR1);
  246.  sprintf(GSTR1,"1H%-10ld",hoozer->Bytes_Upload);
  247.  AEPutStr(GSTR1);
  248.  
  249.  sprintf(GSTR1,"6H%s #Calls%-12ld",(hoozer->New_User?"Yes":"No "),hoozer->Times_Called);
  250.  AEPutStr(GSTR1);
  251.  sprintf(GSTR1,"21H%-10ld",hoozer->Bytes_Download);
  252.  AEPutStr(GSTR1);
  253.  
  254.  sprintf(GSTR2,"%s",ctime(&hoozer->Time_Last_On));
  255.  GSTR2[24]='\0';
  256.  sprintf(GSTR1,"6H%s",GSTR2);
  257.  AEPutStr(GSTR1);
  258.  sprintf(GSTR1,"21H%-10ld",hoozer->Daily_Bytes_Limit);
  259.  AEPutStr(GSTR1);
  260.  
  261.  sprintf(GSTR1,"56H%-16s",ComputerTypes[hoozer->Sec_Bulletin]);
  262.  AEPutStr(GSTR1);
  263.   sprintf(GSTR1,"%sScreenTypes",Cmds->BBSLoc);
  264.   sprintf(GSTR2,"TITLE.%d",hoozer->ScreenType+1);
  265.   AEPutStr("56H");
  266.   if(GetFromIconStr(GSTR1,GSTR2,GSTR2))
  267.   {
  268.     sprintf(GSTR1,"%-16s",GSTR2);
  269.     AEPutStr(GSTR1);
  270.   }
  271.  
  272. //(RTS)
  273.  sprintf(GSTR1,"39HCps UP: %-4hu ",hoozer2->UPcps);
  274.  AEPutStr(GSTR1);
  275.  
  276.  sprintf(GSTR1,"60HCps DN: %-4hu ",hoozer2->DNcps);
  277.  AEPutStr(GSTR1);
  278.  
  279.  sprintf(GSTR1,"17H%-6lu",hoozer->Time_Limit);
  280.  AEPutStr(GSTR1);
  281.  sprintf(GSTR1,"51H%-6lu",hoozer->Time_Used);
  282.  AEPutStr(GSTR1);
  283.  
  284.  sprintf(GSTR1,"76H%d",hoozer->UUCPA);
  285.  AEPutStr(GSTR1);
  286.  
  287. }
  288.  
  289.  
  290. int EditInfo(int which, struct User *hoozer, struct UserKeys *hoozer2)
  291. {
  292. int flag, command;
  293.  
  294.  NOFKeys=1;
  295.  Display_Account(which,hoozer,hoozer2);
  296.  strcpy(GSTR1,hoozer->Name);
  297.  (void)strupr(GSTR1);
  298.  strcpy(hoozer2->UserName,GSTR1);
  299.  
  300.     FOREVER    {
  301.         flag=0;
  302.         command=ReadChar(KEYBOARD_TIMEOUT);
  303.         if(command==NO_CARRIER) return(NO_CARRIER);
  304.         switch(command)    {
  305.             case 'X':                       /* NO-SAVE */
  306.                 AEPutStr("No-Save\r\n");
  307.                 flag=1;
  308.                 break;
  309.             case '\t':
  310.                 flag=2;
  311.                 break;
  312.             case '\177':                    /* DELETE */
  313.                 AEPutStr("Delete\r\n");
  314.                 GI2=which;
  315.                 hoozer->Slot_Number=0;
  316.                 hoozer2->Number=0;
  317.  
  318.              /* changed from ForceSave_Account Thu Jan 30 04:17:48 1992 */
  319.                 GI1=Save_Account(hoozer,hoozer2,GI2,1);
  320.                 if(GI1!=SUCCESS)
  321.                     AEPutStr("Can't Save account\r\n");
  322.                     DeleteConfAccess(GI2);
  323.                 Display_Account_Info(which,hoozer,hoozer2); 
  324.                 flag=0;
  325.                 break;
  326.             case ' ':
  327.                 Display_Account_Info(which,hoozer,hoozer2);
  328.                 break;
  329.             case '+':
  330.                 if(!OnlineEdit) {
  331.                     which=which+1;
  332.                     if(Load_Account(which,hoozer,hoozer2)!=FAILURE)
  333.                         Display_Account_Info(which,hoozer,hoozer2);
  334.                     else {
  335.                         which=1;
  336.                         Load_Account(which,hoozer,hoozer2);
  337.                         Display_Account_Info(which,hoozer,hoozer2);
  338.                     }
  339.                 }
  340.                 break;
  341.             case '-':
  342.                 if(!OnlineEdit)    {
  343.                     which=which-1;
  344.                     if(which<1)
  345.                         which=(int)Find_Last_Account();
  346.                     Load_Account(which,hoozer,hoozer2);
  347.                     Display_Account_Info(which,hoozer,hoozer2);
  348.                 }
  349.                 break;
  350.             case '~': /* SAVE */
  351.                 AEPutStr("Save\r\n");
  352.                     hoozer->New_User=0;
  353.                     Display_Account_Info(which,hoozer,hoozer2);
  354.                 if(hoozer->Slot_Number==0) {
  355.                     hoozer2->Number=0;
  356.                     GI1=Save_Account(hoozer,hoozer2,which,1);  /* 1 = FORCE SAVE */
  357.  
  358.                     if(GI1!=SUCCESS)
  359.                         AEPutStr("Can't Save account\r\n");
  360.                 } else {
  361.                     hoozer2->Number=hoozer->Slot_Number;
  362.                  /* save using Slot_number */
  363.                     GI1=Save_Account(hoozer,hoozer2,0,0); /* Not forced */
  364.                     if(GI1!=SUCCESS)
  365.                         AEPutStr("Can't Save account\r\n");
  366.                 }
  367.                 break;
  368.                case '8': case '7':
  369.             case '6': case '5': case '4': case '3':
  370.             case '2': /* VALIDATE */
  371.             case '1':
  372.                     sprintf(GSTR1,"%c ",command);
  373.                     GI1=(int)atol(GSTR1);
  374.                     AEPutStr("Preset ");
  375.                     AEPutStr(GSTR1);
  376.                     AEPutStr("\r\n");
  377.                         sprintf(GSTR1,"%sACCESS/Preset.%c",Cmds->BBSLoc,command);
  378.  
  379.                         hoozer->New_User=0;
  380.                      GI1-=1;
  381.                     hoozer->New_User=0;
  382.                     hoozer->Sec_Status=IntFromIcon(GSTR1,"PRESET.ACCESS");
  383.                     hoozer->Sec_Library=IntFromIcon(GSTR1,"PRESET.RATIO");
  384.                     hoozer->Time_Limit=IntFromIcon(GSTR1,"PRESET.TIME_LIMIT");
  385.                     hoozer->Sec_Board=IntFromIcon(GSTR1,"PRESET.RATIO_TYPE");
  386.                     GetFromIconStr(GSTR1,"PRESET.AREA",hoozer->Conference_Access);
  387.                     hoozer->Daily_Bytes_Limit=IntFromIcon(GSTR1,"PRESET.DAILY_BYTE_LIMIT");
  388.                     hoozer->Time_Used=0L;
  389.                     hoozer->Time_Total=hoozer->Time_Limit;
  390. hoozer2->UPcps = 0;
  391.              hoozer2->DNcps = 0;
  392. //(RTS)             hoozer2->baud_rate = 0;
  393.                     Save_Account(hoozer,hoozer2,0,0);
  394.                     (void)Display_Account_Info(which,hoozer,hoozer2);
  395.                 break;
  396.              
  397.             case '9':                       /* RE-ACTIVATE */
  398.                 AEPutStr("Re-Activate\r\n");
  399.                 hoozer->Slot_Number=which;
  400.                 flag=0;
  401.                 break;
  402.             case 'a': case 'A':             /* NAME */
  403.                 AEPutStr("0H");
  404.                 LineInput(hoozer->Name,hoozer->Name,30,KEYBOARD_TIMEOUT);
  405.                 strcpy(GSTR1,hoozer->Name);
  406.                 (void)strupr(GSTR1);
  407.                 strcpy(hoozer2->UserName,GSTR1);
  408.                 flag=0;
  409.                 break;
  410.             case 'b': case 'B':             /* Location */
  411.                 AEPutStr("1H");
  412.                 LineInput(hoozer->Location,
  413.                     hoozer->Location,29,KEYBOARD_TIMEOUT);
  414.                 flag=0;
  415.                 break;
  416.  
  417. case 'c': case 'C':        /* PASS */
  418.  
  419.         AEClearMem(GSTR1,32);
  420.         if(Whence_The_Logon>=REMOTE_LOGON && !F6)
  421.             {
  422.             if(User.Slot_Number==1)
  423.                 {
  424.                 AEPutStr("1H                                ");
  425.                 AEPutStr("1H");
  426.                 LineInput(GSTR1,GSTR1,32,KEYBOARD_TIMEOUT);
  427.                 strupr(GSTR1);
  428.                 AEPutStr("1HENCRYPTED                       ");
  429.                 AECryptCpy(hoozer->PassKey,GSTR1);
  430.                 break;
  431.                 }
  432.             }
  433.             else
  434.             {
  435.                 AEPutStr("1H                                1H");
  436.                 LineInput(GSTR1,GSTR1,32,KEYBOARD_TIMEOUT);
  437.                 strupr(GSTR1);
  438.                 AEPutStr("1HENCRYPTED                       ");
  439.                 AECryptCpy(hoozer->PassKey,GSTR1);
  440.                 break;
  441.             }
  442.             flag=0;
  443.             break;
  444.  
  445.  
  446.  
  447.             case 'd': case 'D': /* Phone number */
  448.                 AEPutStr("1H");
  449.                 LineInput(hoozer->PhoneNumber,
  450.                     hoozer->PhoneNumber,12,KEYBOARD_TIMEOUT);
  451.                 flag=0;
  452.                 break;
  453.             case 'e': case 'E': /* RATIO */
  454.                 AEPutStr("1H");
  455.                 hoozer->Sec_Library=NumberInput();
  456.                 flag=0;
  457.                 break;
  458.             case 'f': case 'F': /* conference access */
  459.                 AEPutStr("6H");
  460.                 LineInput(hoozer->Conference_Access,hoozer->Conference_Access,9,KEYBOARD_TIMEOUT);
  461.                     flag=0;
  462.                 break;
  463.             case 'g': case 'G':  /* Ratio Type */
  464.                 AEPutStr("1H");
  465.                 hoozer->Sec_Board=NumberInput();
  466.                     if(hoozer->Sec_Board<0 || hoozer->Sec_Board > 2) 
  467.                     {
  468.                       AEPutStr("\a"); hoozer->Sec_Board=0; }
  469.  sprintf(GSTR1,"HG> Ratio Type ....: %-5hu",hoozer->Sec_Board);
  470.  AEPutStr(GSTR1);
  471.  if(hoozer->Sec_Board==0) AEPutStr(" <-Byte)");
  472.  if(hoozer->Sec_Board==1) AEPutStr(" <-B/F) ");
  473.  if(hoozer->Sec_Board==2) AEPutStr(" <-File)");
  474.  
  475.                 flag=0;
  476.                 break;
  477.             case 'h': case 'H': /* SEC_Level */
  478.   if(Whence_The_Logon>=REMOTE_LOGON && !F6)
  479.                     {
  480.                       if(User.Slot_Number==1)
  481.                       {
  482.                     AEPutStr("6H");
  483.                     hoozer->Sec_Status=NumberInput();
  484.                   }
  485.                     }
  486.                     else
  487.                     {
  488.                     AEPutStr("6H");
  489.                     hoozer->Sec_Status=NumberInput();
  490.                     }
  491.                 flag=0;
  492.                 break;
  493.             case 'i': case 'I':                 /* UPLOADS */
  494.                 AEPutStr("1H");
  495.                 hoozer->Uploads=NumberInput();
  496.                 flag=0;
  497.                 break;
  498.             case 'j': case 'J':                 /* conference ReJoin */
  499.                 AEPutStr("6H");
  500.                 hoozer->ConfRJoin=NumberInput();
  501.              flag=0;
  502.                 break;
  503.             case 'k': case 'K': /* DOWNLOADS */
  504.                 AEPutStr("1H");
  505.                 hoozer->Downloads=NumberInput();
  506.                 flag=0;
  507.                 break;
  508.             case 'l': case 'L': /* MESSAGES_POSTED */
  509.                 AEPutStr("6H");
  510.                 hoozer->Messages_Posted=NumberInput();
  511.                 flag=0;
  512.                 break;
  513.             case 'm': case 'M': /* Bytes Uploaded */
  514.                 AEPutStr("1H");
  515.                 hoozer->Bytes_Upload=LongNumberInput();
  516.                 flag=0;
  517.                 break;
  518.             case 'n': case 'N': /* New user ??  */
  519.                 AEPutStr("6H   6H");
  520.                 command=YesNo(0);
  521.                 if(command)        hoozer->New_User=1;
  522.                 else            hoozer->New_User=0;
  523.                 flag=0;
  524.                 break;
  525.                case '#':
  526.                     AEPutStr("8H");
  527.                     hoozer->Times_Called=LongNumberInput();
  528.                     flag=0;
  529.                     break;
  530.             case 'o': case 'O': /* Bytes Downloaded */
  531.                 AEPutStr("21H");
  532.                 hoozer->Bytes_Download=LongNumberInput();
  533.                 flag=0;
  534.                 break;
  535.             case 'q': case 'Q': /* Daily Bytes Limit */
  536.                 AEPutStr("21H");
  537.                 hoozer->Daily_Bytes_Limit=LongNumberInput();
  538.                 flag=0;
  539.                 break;
  540.             case 'r': case 'R': /* Time_Limit */
  541.                 AEPutStr("17H");
  542.                 hoozer->Time_Limit=LongNumberInput();
  543.                 if(hoozer->Time_Total<hoozer->Time_Limit)
  544.                       hoozer->Time_Total=hoozer->Time_Limit;
  545.                 else {
  546.                     if(Cmds->AcLvl[LVL_KEEP_UPLOAD_CREDIT]<2)
  547.                         hoozer->Time_Total=hoozer->Time_Limit;
  548.                 }
  549.                 if(User.Slot_Number==hoozer->Slot_Number)
  550.                     Time_limit=hoozer->Time_Total-hoozer->Time_Used;
  551.                 flag=0;
  552.                 break;
  553.             case 's': case 'S': /* TIME_USED */
  554.  
  555.                 AEPutStr("51H");
  556.                 hoozer->Time_Used=LongNumberInput();
  557.                 if(User.Slot_Number==hoozer->Slot_Number)
  558.                     Time_limit=hoozer->Time_Total-hoozer->Time_Used;
  559.                 flag=0;
  560.                 break;
  561.             case 't':        case 'T':
  562.                 AEPutStr("76H");
  563.                 hoozer->UUCPA=UUCPNumberInput();
  564.                 flag=0;
  565.                 break;
  566.          case 'y':       case 'Y':         /* zero upcps rate */
  567.              AEPutStr("47H");          /* offset by 11 */
  568.                 hoozer2->UPcps=LongNumberInput();
  569.              flag=0;
  570.              break;
  571.          case 'z':       case 'Z':         /* zero dncps rate */
  572.              AEPutStr("68H");          /* offset by 11 */
  573.                 hoozer2->DNcps=LongNumberInput();
  574.              flag=0;
  575.              break;
  576.  
  577.             default:
  578.                 flag=0;
  579.                 break;
  580.             }
  581.         AEPutStr("1H");
  582.         if(flag) { break; }
  583.         }
  584. NOFKeys=0;
  585. return((UWORD)flag);
  586. }
  587.  
  588. WORD CheckNEdit(WORD which)
  589. {
  590. WORD stat;
  591.  
  592.  GI1=Find_Last_Account();
  593.  if(which>GI1) {
  594.        AEPutStr("Higher Than Maximum Account\r\n");
  595.        return(FAILURE);
  596.  }
  597. AEPutStr("\014");
  598. GI1=Load_Account(which,&GHoozer,&GHoozer2);
  599. if(GI1==FAILURE)
  600.     {
  601.     AEPutStr("Warning, error while loading account\r\n");
  602.     return(FAILURE);
  603.     }
  604. AEPutStr("\017\014");
  605. stat=EditInfo(which,&GHoozer,&GHoozer2);
  606. return(stat);
  607. }
  608.  
  609. int Edit_Accounts(void)
  610. {
  611. WORD stat;
  612. int which,lw;
  613.  
  614.  sprintf(GSTR1,"%sCommands/SysCmd/",Cmds->BBSLoc);
  615.  strcpy(GSTR2,"ACCOUNTS");
  616.  if(!CustomCommand(GSTR1,GSTR2,1))
  617.  {
  618.  FOREVER    {
  619.           AEPutStr("\r\nS>earch by name  N>ew account editing\r\nEdit which account? ");
  620.             GI1=LineInput("",GSTR3,5,KEYBOARD_TIMEOUT);
  621.         if(GI1<=0) { goto RETURNF; }
  622.         if(toupper(GSTR3[0])=='N') {
  623.             List_New_Accounts();
  624.             continue;
  625.         }
  626.  
  627.         if(toupper(GSTR3[0])=='S') {
  628.             AEPutStr("\r\nUserName: ");
  629.             GI1=LineInput("",GSTR3,30,KEYBOARD_TIMEOUT);
  630.             if(GI1<=0)  goto RETURNF;
  631.             lw=0;
  632.             do    {
  633.                 lw++;
  634.                 which=Find_User_From_Name(lw,GSTR3,&GHoozer,&GHoozer2);
  635.                 if(which<=0) {
  636.                     AEPutStr("\r\nSorry no user under that name.\r\n");
  637.                     continue;
  638.                 }
  639.              lw=which;
  640.                 stat=CheckNEdit(which);
  641.             } while(which>0&&stat==2);
  642.             continue;
  643.         }
  644.  
  645.         which=(int)atol(GSTR3);
  646.         if(which<=0)  goto RETURNF;
  647.         CheckNEdit(which);
  648.     }
  649.  RETURNF:
  650.  AEPutStr("\r\n");
  651.  }
  652.  return(SUCCESS);
  653. }
  654.  
  655. int List_New_Accounts(void)
  656. {
  657. int FOFLAG;
  658. int x;
  659. long Maximum,stat;
  660. BPTR fh;
  661.  
  662. OnlineEdit=1;
  663. FOFLAG=0;
  664. AEPutStr("\017\014BSearching...");
  665. Maximum=Find_Last_Account();
  666. strcpy(GSTR1,UserKeyLoc);
  667. if(fh=Open(GSTR1,MODE_OLDFILE))
  668.     {
  669.     for(x=1;x<=Maximum;++x)
  670.         {
  671.         stat=Read(fh,(char *)&GHoozer2,sizeof(struct UserKeys));
  672. //        printf("Name %-31s New User = %d\n",GHoozer2.UserName,GHoozer2.New_User);
  673.         if(stat!=sizeof(struct UserKeys))    {
  674.             sprintf(GSTR2,"FILE-FAULT[%d], ",x);
  675.             AEPutStr(GSTR2);
  676.         } else    {
  677.             if(GHoozer2.New_User==1&&GHoozer2.Number!=0) {
  678.                 FOFLAG=1;
  679.                 Load_Account(x,&GHoozer,&GHoozer2);
  680.                 stat=EditInfo(x,&GHoozer,&GHoozer2);
  681.                 if(stat==1)    {
  682.                     AEPutStr("\r\nAbort\r\n");
  683.                     goto AcctMark1;
  684.                 }
  685.                 AEPutStr("Searching...");
  686.             }
  687.         }
  688.         if(Whence_The_Logon!=LOCAL_LOGON&&Check_Online_Status()<0) {
  689.             Close(fh);
  690.             OnlineEdit=0;
  691.             return(NO_CARRIER);
  692.         }
  693.         if(CheckInput()) {
  694.             stat=ReadChar(KEYBOARD_TIMEOUT);
  695.             switch(stat) {
  696.                 case '\023':
  697.                     PurgeLine();
  698.                     AEPutStr("Any key..");
  699.                     stat=ReadChar(KEYBOARD_TIMEOUT);
  700.                     if(stat==TIMEOUT||stat==NO_CARRIER) {
  701.                         Close(fh);
  702.                         OnlineEdit=0;
  703.                         return(stat);
  704.                     }
  705.                  AEPutStr("\b\b\b\b\b\b\b\b\b         \b\b\b\b\b\b\b\b\b");
  706.                     break;
  707.                 case '\003': /* ^C */
  708.                     AEPutStr("\r\nAbort\r\n");
  709.                     goto AcctMark1;        break;
  710.                 default:
  711.                     PurgeLine();
  712.                     break;
  713.                 }
  714.             }
  715.         }
  716.         AcctMark1:
  717.         if(!FOFLAG)        AEPutStr("No new users.");
  718.         Close(fh);
  719.     }
  720.  AEPutStr("\r\n\r\n");
  721.  OnlineEdit=0;
  722.  return(SUCCESS);
  723. }
  724.  
  725. void DeleteConfAccess(int slot)
  726. {
  727.    BPTR bi;
  728.    struct ConfBase t;
  729.    int i;
  730.    char temp[100];
  731.    char Conference_Location[100];
  732.    for(i=0;i<Boards_Are_Active;i++)
  733.    {
  734.      GetConfName(temp,Conference_Location,i);
  735.      sprintf(temp,"%sConf.DB",Conference_Location);
  736.    bi=Open(temp,MODE_OLDFILE);
  737.    if(bi==NULL)
  738.    {
  739.      return;
  740.    }
  741.  
  742.    Seek(bi,(ULONG)(slot-1)*(ULONG)(sizeof(struct ConfBase)),OFFSET_BEGINNING);
  743.    FRead(bi,(APTR)&t,sizeof(struct ConfBase),1);
  744.    t.ConfRead=0;
  745.                t.NewSinceDate=0L;
  746.                t.ConfRead=0;
  747.                t.ConfYM=0;
  748.                t.Bytes_Download=0L;
  749.                t.Bytes_Upload=0L;
  750.                t.Daily_Bytes_Limit=0L;
  751.                t.Daily_Bytes_Dld=0L;
  752.                t.Upload=0;
  753.                t.Downloads=0;
  754.                t.RatioType=0;
  755.                t.Ratio=0;
  756.                t.Messages_Posted=0;
  757.                t.Active=0;
  758.                t.Access=0;
  759.    Seek(bi,(ULONG)(slot-1)*(ULONG)(sizeof(struct ConfBase)),OFFSET_BEGINNING);
  760.    Write(bi,(APTR)&t,sizeof(struct ConfBase));
  761.  
  762.    Close(bi);
  763.   }
  764.   GetConfName(temp,Conference_Location,CN-1);
  765. }
  766.